//
//  ServiceTime.m
//  etionCBLogic
//
//  Created by wangjian on 10/17/13.
//
//

#import "XLGServiceTime.h"

#import "XLGServiceTimeInternal.h"

static XLGServiceTimeInternal *s_serviceTimeInternal;

@implementation XLGServiceTime

+ (BOOL)isServiceStart
{
    return s_serviceTimeInternal != nil;
}

+ (void)startService
{
    if (s_serviceTimeInternal == nil)
    {
        s_serviceTimeInternal = [XLGServiceTimeInternal new];
    }
}

+ (void)endService
{
    [s_serviceTimeInternal endCountTime];
    [s_serviceTimeInternal release];
    s_serviceTimeInternal = nil;
}

+ (void)verifyTime:(BOOL)isCountInterrupted
{
    [s_serviceTimeInternal verifyTime:isCountInterrupted];
}

+ (NSDate *)date
{
    if (s_serviceTimeInternal == nil)
    {
        return [NSDate date];
    }
    return [s_serviceTimeInternal date];
}

+ (XLGServiceTimeType)currentTimeType
{
    return [s_serviceTimeInternal currentTimeType];
}

@end
